package com.changdu.seatunnel.admin.service;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.changdu.seatunnel.admin.entity.DataTemplate;
import com.changdu.seatunnel.admin.mapper.DataTemplateMapper;

@Service
public class DataTemplateService extends ServiceImpl<DataTemplateMapper, DataTemplate> {

	/**
	 * 根据模板名称查询模板
	 *
	 * @param templateName 模板名称
	 * @return 模板对象
	 */
	public DataTemplate getByName(String templateName) {
		LambdaQueryWrapper<DataTemplate> wrapper = new LambdaQueryWrapper<>();
		wrapper.eq(DataTemplate::getName, templateName);
		return getOne(wrapper);
	}
} 